const config = {
  width: 0,
  height: 0,
  dom: document.body
}


class Canvas {
  constructor({
    dom,
    width,
    height,
  } =  config) {
    this.dom = dom;
    this.width = width || dom.offsetWidth;
    this.height = height || dom.offsetHeight;
    this.canvas = document.createElement('canvas')
    console.log(this.dom.offsetHeight)
    this.canvas.height = this.height
    this.canvas.width = this.width
    this.dom.appendChild(this.canvas)
    this.context = this.canvas.getContext('2d')
  }
}
export default Canvas